import request from '@/config/axios'

// 服务关注 VO
export interface ServiceVO {
  id: number // id主键
  remarks: string // 备注信息
  delFlag: string // 逻辑删除标记
  eldenId: number // 老登ID
  serviceid: number // 服务项目ID
  amount: number // 购买数量
  buytime: Date // 服务购买日
  maturitytime: Date // 服务到期日
  otherinfo: string // 备注
}

// 服务关注 API
export const ServiceApi = {
  // 查询服务关注分页
  getServicePage: async (params: any) => {
    return await request.get({ url: `/yyzx/service/page`, params })
  },

  // 查询服务关注详情
  getService: async (id: number) => {
    return await request.get({ url: `/yyzx/service/get?id=` + id })
  },

  // 新增服务关注
  createService: async (data: ServiceVO) => {
    return await request.post({ url: `/yyzx/service/create`, data })
  },

  // 修改服务关注
  updateService: async (data: ServiceVO) => {
    return await request.put({ url: `/yyzx/service/update`, data })
  },

  // 删除服务关注
  deleteService: async (id: number) => {
    return await request.delete({ url: `/yyzx/service/delete?id=` + id })
  },

  // 导出服务关注 Excel
  exportService: async (params) => {
    return await request.download({ url: `/yyzx/service/export-excel`, params })
  },
}